package com.ruoyi.cms.controller;

import com.ruoyi.cms.service.CIndexService;
import com.ruoyi.cms.vo.IndexCountVO;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Choi
 * @Date 2021/8/25
 */

@RestController
@RequestMapping("/cms")
public class CIndexController {

    @Autowired
    private CIndexService cIndexService;

    /**
     * 首页
     */
    @PreAuthorize("@ss.hasAnyPermi('cms:index')")
    @GetMapping("/index")
    public AjaxResult index() {
        IndexCountVO counts = cIndexService.getCounts();
        return AjaxResult.success(counts);
    }

}
